package org.springds3.d2.dao.impl;

import org.mybatis.spring.SqlSessionTemplate;
import org.springds3.d2.dao.NewsTypeMapper;
import org.springds3.d2.pojo.NewsType;

import java.util.List;

public class NewsTypeMapperImpl implements NewsTypeMapper {

    private SqlSessionTemplate sqlSession;

    public SqlSessionTemplate getSqlSession() {
        return sqlSession;
    }

    public void setSqlSession(SqlSessionTemplate sqlSession) {
        this.sqlSession = sqlSession;
    }

    //SqlSessionTemplate是sqlSession的实现类
    @Override
    public List<NewsType> getAllNewsTypes() {
        return sqlSession.getMapper(NewsTypeMapper.class).getAllNewsTypes();
    }
}
